//
//  AppDelegate.m
//  KafeeSale
//
//  Created by Liboom on 2025/6/8.
//

#import "AppDelegate.h"
#import "NewTabbarVC.h"
#import "IQKeyboardManager.h"
#import "KFLoginVC.h"
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
    manager.enable = YES;//控制整个功能是否启用。
    manager.shouldResignOnTouchOutside = YES;//控制点击背景是否收起键盘
    manager.shouldShowToolbarPlaceholder = NO;//中间位置是否显示占位文字
    //设置占位文字的字体
    //    manager.placeholderFont = [UIFont boldSystemFontOfSize:17];
    manager.enableAutoToolbar = YES;//控制是否显示键盘上的工具条。
    NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
    NSDictionary * user = [def objectForKey:@"userInfo"];
    NSString * ipDomain = [def objectForKey:@"ipDomain"];
    if (ipDomain.length == 0){
        [def setObject:@"http://43.138.162.50:1300" forKey:@"ipDomain"];
        [def setObject:@"http://43.138.162.50:1300/uploads" forKey:@"ipOssDomain"];
    }
    if (user[@"token"]) {
        self.window.rootViewController = [NewTabbarVC new];
    }else{
        self.window.rootViewController = [KFLoginVC new];
    }
    return YES;
}


@end
